<!DOCTYPE html>
<html>
	<head>
		<#include "/templates/commons/head.html">
		<script type="text/javascript">
			/**
			*  保存个人资料信息
			*/
			function save(){
			  	if(!$("#opForm").validateForm()){
					return;
			   	}
				document.opForm.action = "${ctx}/UserController/savePresonInfo.do";

				if(!confirm("您是否确定要修改？")){
					return;
				}
				document.opForm.submit();
			}

			/**
			*  重置个人资料信息
			*/
			function goBack(){
				document.opForm.action = "${ctx}/UserController/getPresonInfo.do";
				document.opForm.submit();
			}	
		</script>
	</head>
	<body>
		<div id="div-body" class="body">
			<div class="hid-scroller-body">
				<#include "/templates/commons/menuPath.html">
				<form id="opForm" name="opForm" method="post" action="">
					<div id="div-message">${message!}</div>
					<input type="hidden" name="userId" value="${Session.USER_ID!}"/>
					<div class="main-container">
						<div class="layui-form-item">
							<label class="layui-form-label">名称</label>
							<div class="layui-input-block">
								<span class="layui-input">${Session.USER_NAME!}</span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">帐号</label>
							<div class="layui-input-block">
								<span class="layui-input">${Session.USER_ACCOUNT!}</span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">原密码</label>
							<div class="layui-input-block">
								<input type="password" name="oldPassword" id="oldPassword" isValidate="true" notEmpty="true" leng="40" placeholder="请输入原密码" class="layui-input" lay-verify="title"/>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">新密码</label>
							<div class="layui-input-block">
								<input type="password" name="newPassword" id="newPassword" isValidate="true" notEmpty="true" leng="40" placeholder="请输入新密码" class="layui-input" lay-verify="title"/>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">确认新密码</label>
							<div class="layui-input-block">
								<input type="password" name="password" id="againPassword" isValidate="true" notEmpty="true" confirmSameValue="newPassword" leng="40" placeholder="请确认新密码" class="layui-input" lay-verify="title"/>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">联系电话</label>
							<div class="layui-input-block">
								<input type="text" name="mobile" id="mobile" value="${Session.USER_MOBILE!}" isValidate="true" isPhone="true" placeholder="请确认联系电话" class="layui-input" lay-verify="title"/>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">邮箱</label>
							<div class="layui-input-block">
								<input type="text" name="email" id="email" value="${Session.USER_EMAIL!}" isValidate="true" isEmail="true" leng="50" placeholder="请确认邮箱" class="layui-input" lay-verify="title"/>
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<#if Session.CUR_MENU.updateRole == 1>
								<input type="button" value="保存" class="layui-btn" onclick="save();"/>
							</#if>
							<input type="button" class="layui-btn layui-btn-primary" value="重置" onClick="goBack();"/>
						</div>
					</div>
				</form>
			</div>
		</div>
	</body>
</html>